<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/views/include/nocachehead.jsp"%>
<title>所有视频</title>
<link href="${pageContext.request.contextPath}/css/base.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/share.js"></script>
</head>
<body>
<skyline:setSessionAttrToVar var="user" key="SESSION_USER"/>
<c:set var="ownerId" scope="page" value="${requestScope.ownerId}" />
<c:set var="videos" scope="page" value="${requestScope.videos}" />
<skyline:page page="${requestScope.page }" url="" maxSize="6" curClass="curclass curclass2" curStyle="curstyle" normalClass="norClass norclass2" normalStyle="norstyle" decStr="%s"/>
<c:forEach var="video" items="${videos}">
	<table class="articleTable">
		<tr>
			<td colspan='2'>
			<a class="articleTitleA" href="<%=request.getContextPath()%>/video/view/${video.id}.html">${video.title}</a>
			</td>
		</tr>
		<tr>
			<td colspan='2'>
			<font class="articleInfoFont">
			发表于:<fmt:formatDate value="${video.createTime}" type="both"/>
			</font>
			</td>
		</tr>
		<tr>
			<td colspan='2'>
			<p><img src="${video.thumbnail }"></p>${video.summary}......
			</td>
		</tr>
		<tr>
			<td width='50%' align='left'>
		<font class="articleInfoFont">阅读(${video.visitNum})&nbsp;&nbsp;分享(${video.shareNum})&nbsp;&nbsp;评论(${video.commentNum})</font>
			</td>
			<td width='50%' align='right'>
			<c:choose>
				<c:when test="${user!=null&&ownerId!=null&&user.id==ownerId}">
					<a href="<%=request.getContextPath() %>/video/delete/${video.id}.html" onclick="return confirm('你确定删除此视频么?\n\n提示:删除视频后将不可恢复.');" class="deleteA">删除</a>&nbsp;
				</c:when>
			</c:choose>
			<skyline:share type="VIDEO" value="分享" curClass="shareA" resourceId="${video.id }"/>
			&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
	</table>
</c:forEach>
<br>
<skyline:page page="${requestScope.page }" url="" maxSize="6" curClass="curclass curclass2" curStyle="curstyle" normalClass="norClass norclass2" normalStyle="norstyle" decStr="%s"/>
</body>
</html>